home *** CD-ROM | disk | FTP | other *** search
- program DemoE005;
- {------------------------------------------------------------------------------
- DBase File Editor
- Expanded Sample 5
- Demo Program
-
- Copyright (c) Richard F. Griffin
-
- 10 February 1992
-
- 102 Molded Stone Pl
- Warner Robins, GA 31088
-
- -------------------------------------------------------------
- Use FieldUpdateScreen to display and edit all record fields
- on-screen. This example uses an index file.
-
- ********** Not For Use in a TurboVision Environment **********
-
- If it does not already exist, the DEMOE5.DBF file will be created
- by using the MakeTestData procedure in GS_GENF.PAS.
-
- All fields in the dBase record will be displayed on-screen using
- the FieldUpdateScreen procedure in GS_dBFld_Objt. All fields may
- be edited and the record will be updated. The memo record may also
- be viewed and modified.
-
- Keys that may be used are:
-
- ESC Exits
- F10 Next Record
- PgUp Top of Record; Previous Record if Already at Top
- PgDn Bottom of Record; Next Record if at Bottom
- Cursor Up, Down
-
- -------------------------------------------------------------------------------}
-
- uses
- CRT,
- DOS,
- GS_KeyI,
- GS_FileH,
- GS_dBFld,
- GS_dBase,
- GS_GenF;
- var
- MyFile : GS_dBFld_Objt;
- CkFile : file;
- NewFile : boolean;
-
- begin
- ClrScr;
- if not GS_FileExists(CkFile,'DEMOE5.DBF') then
- begin
- writeln('Creating DEMOE5.DBF');
- MakeTestData('DEMOE5', 20, true);
- writeln('DEMOE5.DBF Created');
- ClrScr;
- NewFile := true;
- end
- else NewFile := false;
- MyFile.Init('DEMOE5');
- MyFile.Open;
- if NewFile then MyFile.IndexTo('DEMOE5','LASTNAME');
- MyFile.Index('DEMOE5');
- MyFile.GetRec(Top_Record);
- while (MyFile.FieldUpdateScreen) do
- begin
- if MyFile.RecChanged then MyFile.PutRec(MyFile.RecNumber);
- if GS_KeyI_Chr = Kbd_PgUp then
- MyFile.GetRec(Prev_Record)
- else
- MyFile.GetRec(Next_Record);
- end;
- MyFile.Close;
- end.
-